<template>
	<div>
		<Bread>
			<template v-slot:title>

				<el-breadcrumb-item v-for="(item, index) in titleList" :key="index"> {{ item }}</el-breadcrumb-item>

			</template>
		</Bread>
		<Card />
	</div>
</template>

<script>
import Bread from '../../components/Bread.vue'
import Card from '../../components/Roles/Card.vue'
export default {
	name: 'Rights',
	data() {
		return {
			titleList: ['权限管理', '角色列表'],
			keys: [],

		}
	},
	components: {
		Bread,
		Card,
	},
	methods: {
		getList() {
			this.$http.get('/roles').then(response => {
				const { data, meta } = response.data
				if (meta.status != 200) {
					this.$message.error('获取角色列表失败')
				}
				this.$bus.$emit('getRolesData', data)
			})
		},
	},
	created() {
		this.getList()
		this.$bus.$on('Rolesreload', () => {
			this.getList()
		})

	},
}
</script>
